function rate=massFunction(mass)
% massfunction for log
%hurley 2008
global  AllmassNUM M1MAX M1MIN SFR qNUM aNUM alpha
m0=0.1;
if(mass>1)
    rate=(mass/M1MIN)^(-1.7)*SFR*(log(M1MAX)-log(M1MIN))...
        ./AllmassNUM/qNUM/aNUM.*1d6 * (alpha-1);
% rate=exp(-0.3.*mass);
else
    rate=NaN;
end

end